package com.cn.yz.springboot.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cn.yz.springboot.mapper.OpLogMapper;
import com.cn.yz.springboot.model.OpLog;
import com.cn.yz.springboot.service.OpLogService;
import com.github.pagehelper.PageHelper;

/**
 * <pre>
 * @author 
 *
 * @version 0.1
 *
 * 修改版本: 0.1
 * 修改日期: 2017-05-24
 * 修改人 :  
 * 修改说明: 初步完成
 * 复审人 ：
 * </pre>
 */
@Service
public class OpLogServiceImpl implements OpLogService {

	@Autowired
	private OpLogMapper opLogMapper;

	@Override
	public List<OpLog> findOpLogByCondition(Map<String, Object> condition) {
		PageHelper.startPage(1, 2);
		return opLogMapper.findOpLogByCondition(condition);
	}

	@Override
	public long getOpLogCount(Map<String, Object> condition) {
		return opLogMapper.getOpLogCount(condition);
	}

	@Override
	public boolean addOpLog(OpLog opLog) {
		return opLogMapper.insertSelective(opLog)>0;
	}

	@Override
	public OpLog findOpLogById(String id, String opYear) {
		
		return opLogMapper.findOpLogById(id, opYear);
	}
}
